﻿@model IEnumerable<MVCApp.Models.UserProfile>

@{
    int counter = 1;
}

<table>
    <tr>
        <th>#</th>
        <th>
            @Html.DisplayNameFor(model => model.UserName)
        </th>
        <th>
            Roles
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @{
                @counter@:.
                counter = counter + 1;
            }
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.UserName)
        </td>
        <td>
            @string.Join(", ", item.GetRoles())
        </td>
        <td>
            @Html.ActionLink(Strings.Edit, "Edit", new { id=item.UserId })
            @Html.ActionLink(Strings.Delete, "Delete", new { id=item.UserId })
        </td>
    </tr>
}

</table>
